package home_work4;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class test4 {

	public static void main(String[] args) {
		List<Integer>list=new ArrayList<>();
		Collections.addAll(list, 0,1,2,3,4,5,6,7,8,9);
		List list1=list.subList(3, 7);
		System.out.println(list.subList(3, 7));
		for(int i=0;i<10;i++) {
		list1.addAll(list1);
		}
		System.out.println(list);
		Iterator <Integer>it=list.iterator();
		while (it.hasNext()) {
            int i = it.next();
            if(i==7||i==8||i==9) {
            	it.remove();
            }      
     }
		System.out.println(list);
	}

}
